package com.example.android2019.ch6service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class MyService1 extends Service {
    public MyService1() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        Log.v("myService", "onBind方法");
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        /* 参数1：tag 标记，在Logcat可以通过该标记过滤信息
        * 参数2：msg 内容*/
        Log.v("myService", "onCreate方法");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.v("myService", "onStartCommand方法");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.v("myService", "onDestroy方法");
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.v("myService", "onUnbind方法");
        return super.onUnbind(intent);
    }

    @Override
    public void onRebind(Intent intent) {
        super.onRebind(intent);
        Log.v("myService", "onRebind方法");
    }
}
